<!--
 * @Description: 
 * @Author: Rabbiter
 * @Date: 2023-02-24 18:08:34
-->
<template>
  <div class="welcome">
    <div class="loader">
      <div class="loader-ring">
        <div class="loader-sector">W</div>
        <div class="loader-sector">e</div>
        <div class="loader-sector">l</div>
        <div class="loader-sector">c</div>
        <div class="loader-sector">o</div>
        <div class="loader-sector">m</div>
        <div class="loader-sector">e</div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
      </div>
      <div class="loader-ring">
        <div class="loader-sector">W</div>
        <div class="loader-sector">e</div>
        <div class="loader-sector">l</div>
        <div class="loader-sector">c</div>
        <div class="loader-sector">o</div>
        <div class="loader-sector">m</div>
        <div class="loader-sector">e</div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
        <div class="loader-sector"></div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Welcome",
};
</script>

<style scoped>
.welcome {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  height: 100vh;
  background-image: linear-gradient(to top, #09203f 0%, #537895 100%);
  color: rgb(111, 218, 232);
  font-size: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.loader {
  width: 500px;
  height: 500px;
  /* 弹性布局 居中 */
  display: flex;
  justify-content: center;
  align-items: center;
  /* 垂直排列 */
  flex-direction: column;
  /* 绑定动画：动画名 时长 线性 无限播放 */
  animation: tiltSpin 8s linear infinite;
}
.loader,
.loader-ring {
  /* 开启3D */
  transform-style: preserve-3d;
}
.loader-ring {
  font-size: 56px;
  position: relative;
  width: 42px;
  height: 84px;
  /* 绑定动画 */
  animation: spin 4s linear infinite;
}
/* 第二个环 */
.loader-ring:nth-child(2) {
  /* 反向动画 */
  animation-direction: reverse;
}
.loader-sector {
  font-weight: 600;
  /* 转大写 */
  text-transform: uppercase;
  /* 绝对定位 */
  position: absolute;
  top: 0;
  left: 0;
  text-align: center;
  transform: translateZ(200px);
}
.loader-sector,
.loader-sector:empty::before {
  display: inline-block;
  width: 100%;
  height: 100%;
}
/* 画线段 */
.loader-sector:empty::before {
  content: "";
  background: linear-gradient(
    transparent 45%,
    currentColor 45% 50%,
    transparent 55%
  );
}
/* 分别为每个div设置旋转角度和Z轴偏移量 */
.loader-sector:nth-child(2) {
  transform: rotateY(12deg) translateZ(200px);
}
.loader-sector:nth-child(3) {
  transform: rotateY(24deg) translateZ(200px);
}
.loader-sector:nth-child(4) {
  transform: rotateY(36deg) translateZ(200px);
}
.loader-sector:nth-child(5) {
  transform: rotateY(48deg) translateZ(200px);
}
.loader-sector:nth-child(6) {
  transform: rotateY(60deg) translateZ(200px);
}
.loader-sector:nth-child(7) {
  transform: rotateY(72deg) translateZ(200px);
}
.loader-sector:nth-child(8) {
  transform: rotateY(84deg) translateZ(200px);
}
.loader-sector:nth-child(9) {
  transform: rotateY(96deg) translateZ(200px);
}
.loader-sector:nth-child(10) {
  transform: rotateY(108deg) translateZ(200px);
}
.loader-sector:nth-child(11) {
  transform: rotateY(120deg) translateZ(200px);
}
.loader-sector:nth-child(12) {
  transform: rotateY(132deg) translateZ(200px);
}
.loader-sector:nth-child(13) {
  transform: rotateY(144deg) translateZ(200px);
}
.loader-sector:nth-child(14) {
  transform: rotateY(156deg) translateZ(200px);
}
.loader-sector:nth-child(15) {
  transform: rotateY(168deg) translateZ(200px);
}
.loader-sector:nth-child(16) {
  transform: rotateY(180deg) translateZ(200px);
}
.loader-sector:nth-child(17) {
  transform: rotateY(192deg) translateZ(200px);
}
.loader-sector:nth-child(18) {
  transform: rotateY(204deg) translateZ(200px);
}
.loader-sector:nth-child(19) {
  transform: rotateY(216deg) translateZ(200px);
}
.loader-sector:nth-child(20) {
  transform: rotateY(228deg) translateZ(200px);
}
.loader-sector:nth-child(21) {
  transform: rotateY(240deg) translateZ(200px);
}
.loader-sector:nth-child(22) {
  transform: rotateY(252deg) translateZ(200px);
}
.loader-sector:nth-child(23) {
  transform: rotateY(264deg) translateZ(200px);
}
.loader-sector:nth-child(24) {
  transform: rotateY(276deg) translateZ(200px);
}
.loader-sector:nth-child(25) {
  transform: rotateY(288deg) translateZ(200px);
}
.loader-sector:nth-child(26) {
  transform: rotateY(300deg) translateZ(200px);
}
.loader-sector:nth-child(27) {
  transform: rotateY(312deg) translateZ(200px);
}
.loader-sector:nth-child(28) {
  transform: rotateY(324deg) translateZ(200px);
}
.loader-sector:nth-child(29) {
  transform: rotateY(336deg) translateZ(200px);
}
.loader-sector:nth-child(30) {
  transform: rotateY(348deg) translateZ(200px);
}

/* 定义动画 */
/* 倾斜旋转动画 */
@keyframes tiltSpin {
  from {
    transform: rotateY(0) rotateX(30deg);
  }
  to {
    transform: rotateY(1turn) rotateX(30deg);
  }
}
/* 旋转动画 */
@keyframes spin {
  from {
    transform: rotateY(0);
  }
  to {
    transform: rotateY(1turn);
  }
}
</style>